package day1020;

import java.util.*;

public class Test3 {

    public static void main(String[] args) {


        List<String>   list1=   new ArrayList<>();//线性表：队列  查询快     增删元素慢(末尾增删快)

        List<String>   list2=   new LinkedList<>();//链表：铁链   查询慢(头尾查询快)     增删元素快
        list1.add("张三");
        list2.add("李四");



        LinkedList stack=   new LinkedList();
        stack.push(1);//入栈
        stack.pop();//出栈
        stack.peek();//获取栈顶元素//复制



        Queue list=   new LinkedList();
        list.add(1);
        list.remove();



        Deque list3=   new LinkedList();
        list3.addLast(1);
        list3.removeLast();



        list3.addFirst(2);
        list3.removeFirst();















    }

}









